package com.atguigu.gulimall.product.feign;

import com.atguigu.common.utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @Description:
 * @Created: with IntelliJ IDEA.
 * @author: 夏沫止水
 * @createTime: 2020-06-06 15:50
 **/

@FeignClient("gulimall-ware")
public interface WareFeignService {

    @PostMapping(value = "/ware/waresku/hasStock")
    R getSkuHasStock(@RequestBody List<Long> skuIds);

    //TODO 查看feign调用源码
    /**
     * feign调用流程
     * 1.构造请求数据,将对象转为json RequestTemplate template=buildTemplateFromArgs.create(argv);
     * 2.发送请求执行(执行成功后会解码响应数据) executeAndDecode(template)
     * 3.执行请求会有重试机制
     */

}
